import request from '@/config/request';
import { LoginFormTypes, LoginReturnTypes, EditPasswordTypes } from '@/types/login';

// 登录
export function registerLogin (data: LoginFormTypes): Promise<LoginReturnTypes> {
  return request({
    url: '/busines/user/login',
    method: 'POST',
    data,
    isWhiteList: true
  })
}

// 用户密码重置
export function updateUserPwd(data: EditPasswordTypes) {
  return request({
    url: `/system/user/profile/updatePwd?oldPassword=${data.oldPassword}&newPassword=${data.newPassword}`,
    method: 'PUT'
  })
}

// 获取用户信息
export function getInfo () {
  return request({
    url: '/busines/user/getInfo',
    method: 'GET',
  })
}

